package be.kuleuven.cs.mop.util;



/**
 * Utility class to work with HTML formatting
 */
public abstract class HTML {
	
	public static final String cell(final Object content) {
		return new StringBuilder("<td>").append(content.toString()).append("</td>")
		.toString();
	}
	
	public static final String row(final String... cells) {
		final StringBuilder sb = new StringBuilder("<tr>");
		for (final String cell : cells)
			sb.append(cell);
		return sb.append("</tr>").toString();
	}
	
	public static final String table(final String... rows) {
		final StringBuilder sb = new StringBuilder("<table>");
		for (final String row : rows)
			sb.append(row);
		return sb.append("</table>").toString();
	}
	
	public static final String wrap(final String body) {
		return new StringBuilder(26 + body.length())
		.append("<html><body>").append(body).append("</body></html>")
		.toString();
	}
	
}